import request from '@/utils/request'
import { CHECC_API_BASE_DATA } from '@/constants/proxy'

// 获取通道列表
export function requestChannelList(params:any,data: any): Promise<any> {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-channel-in/page`,
    method: 'post',
    params,
    data:data,
  })
}

// 保存通道信息
export function saveChannel(data: any): Promise<any> {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-channel-in`,
    method: 'post',
    data
  })
}

// 保存通道信息
export function getChannel(id: any): Promise<any> {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-channel-in/${id}`,
    method: 'get',
  })
}

// 删除通道信息
export function delChannel(data: any): Promise<any> {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-channel-in`,
    method: 'delete',
    data
  })
}

// 更新通道信息
export function updateChannel(data: any): Promise<any> {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-channel-in`,
    method: 'PUT',
    data
  })
}

// 锁定/解锁
export function bridgeLock(data: any): Promise<any> {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-channel-in/bridgeLock`,
    method: 'POST',
    data
  })
}

/**
 * 改变通道最近技术状况评定情况子表养护工区详细信息
 *
 * @export
 * @param {*} id
 * @return {*}
 */
 export function evaluation(method: any, data: any) {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-channel-in-evaluation`,
    method,
    data,
  })
}

/**
 * 获取行政区域子表单挑详细信息
 *
 * @export
 * @param {*} id
 * @return {*}
 */
 export function evaluationdata(data: any, params: any = { pageNum: 1, pageSize: 10 }) {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-channel-in-evaluation/page`,
    method: 'post',
    data,
    params,
  })
}

export function evaluationList(data: any) {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-channel-in-evaluation/list`,
    method : 'post',
    data,
  })
}
/**
 * 改变通道修建工程记录子表养护工区详细信息
 *
 * @export
 * @param {*} id
 * @return {*}
 */
 export function construction(method: any, data: any) {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-channel-in-construction`,
    method,
    data,
  })
}

/**
 * 获取行政区域子表单挑详细信息
 *
 * @export
 * @param {*} id
 * @return {*}
 */
 export function constructiondata(data: any, params: any = { pageNum: 1, pageSize: 10 }) {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-channel-in-construction/page`,
    method: 'post',
    data,
    params,
  })
}

export function constructionList(data: any) {
  return request({
    url: CHECC_API_BASE_DATA + `/bd-channel-in-construction/list`,
    method: 'post',
    data,
  })
}